<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt" %> 
<style>
.all_list select {
	height: 22px;
	line-height: 22px;
	width: 80px;
}
.editor table {
	display: inline;
	vertical-align: top;
}

</style>

<form id="add_form" action="">
	<ul class="all_list">
		<li>
			<span class="all_title">标题：</span>
			<span>
				<input class="ui_input" id="title2"  value="${portalNotes.title}" validator='{"label":"标题"}'  name="title" style="width:250px;">
			</span>
		</li>
		<li>
			<span class="all_title">有效时间：</span>
				<span>
					<input type="text" class=" Wdate"  value="<fmt:formatDate value="${portalNotes.beginTime}"  pattern="yyyy-MM-dd HH:mm" />" id="beginDate2" name="beginDate" value=""  onclick="var endDate2=$dp.$('endDate2');WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',onpicked:function(){d5222.focus();},maxDate:'#F{$dp.$D(\'endDate2\')}'})"> -
					<input type="text" class=" Wdate" value="<fmt:formatDate value="${portalNotes.endTime}"  pattern="yyyy-MM-dd HH:mm" />" id="endDate2" name="endDate" value="" validator='{"label":"有效时间","required":true}' onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{$dp.$D(\'beginDate2\')}'})">
				</span>
		</li>
		<li class="editor m-t10">
			<span class="all_title">内容：</span> 
			<span>
				<textarea id="content2" name="content" class="xheditor {tools:'FontSize,FontColor,Bold,Italic,Underline,Strikethrough,Fullscreen,Align,About',skin:'default',height:'300'}" rows="8" cols="80" style="width:70%">${portalNotes.content}</textarea>
				<span id="contentError"></span>
			</span>
		</li>
		<li>
			<span class="all_title"></span>
			<span> 
				<input type="button" id="query" value="修改" class="btn_blue m-r15 submitBtn">
				<input type="reset" id="reset_button" value="重置" class="reset_btn m-r15 resetBtn">
				<input type="hidden" name="id" value="${portalNotes.id}">
			</span>
		</li>
	</ul>
</form>
<script type="text/javascript">
	$(function(){
		$('#content2').xheditor();
		$('#reset_button').click(function(){
			$('#content2').val('');
			$('#title2').val('');
		}); 
		$("#add_form").validator({}, {
			callback:function(data){
				
				var x = $("#content2").val();
				if(x.trim()==''){
					alert("内容不能为空");
					return;
				}
				var param = {};			
				var paramArray = $('#add_form').serializeArray();
				for (var i in paramArray) {
					param[paramArray[i].name] = paramArray[i].value;
				}
				$.post('portalnotification/modify',param,function(data){
					art.dialog({icon: data.success,content: data.message,lock:true});
					if (data.success == "succeed") {
						myDialog2.close();
						$("#gridTable").jqGrid("setGridParam",{datatype : 'json'}).trigger("reloadGrid", [ {page : 1} ] );
					}
				});
			}
		});
	});
		
</script>